package com.csu.ourpetstore1.domain;

import java.math.BigDecimal;

public class CartItem  {

  private int id;
  private String username;
  private int quantity;
  private int inStock;
  private Item item;
  private BigDecimal total;

  public Item getItem() {
    return item;
  }

  public void setItem(Item item1) {
    this.item = item1;
  }

//  private void calculateTotal() {
////    if (item.getItemId() != null && item.getListPrice() != null) {
////      total = item.getListPrice().multiply(new BigDecimal(quantity));
////    } else {
////      total = null;
////    }
//  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public int getInStock() {
    return inStock;
  }

  public void setInStock(int inStock) {
    this.inStock = inStock;
  }

  public int getQuantity() {
    return quantity;
  }

  public void setQuantity(int quantity) {
    this.quantity = quantity;
//    calculateTotal();
  }

  public void setTotal(BigDecimal total) {
    this.total = total;
  }

  public BigDecimal getTotal() {
    return total;
  }
}
